const http = require('http')

const server = http.createServer((req /*请求*/ , res /*响应*/ ) => {
        console.log(req.url)
        res.setHeader('Content-Type', 'text/html; charset=utf-8')
        if (req.url === '/index.html' || req.url === '/') {
            res.write('这是首页')
        } else if (req.url === '/html/login.html')
            res.write('这不是首页')
        res.end() //响应结束
        console.log('Hello')
    })
    //端口监听
server.listen(3000)